from pydantic import BaseModel
from ipaddress import IPv4Address


class Config(BaseModel):
    block_ip: IPv4Address = IPv4Address('10.16.0.200')
    block_port: int = 3000
    server_ip: IPv4Address = IPv4Address('10.16.0.140')
    server_port: int = 5001
    netmask: IPv4Address = IPv4Address('255.255.255.0')
    gateway: IPv4Address = IPv4Address('10.16.0.1')


class BlockInfo(BaseModel):
    block_name: str = 'Имя по умолчанию'
    serial_number: str = '2301 01'
    mac_address: str = '00:b0:33:ff:f8:00'
    version_info: str = '1.0.7'


class ModemConfig(BaseModel):
    user: str = 'gdata'
    password: str = 'gdata'
    ping_address: IPv4Address = IPv4Address(bytes([77, 88, 8, 8]))
    apn: str = 'internet'
    sim_ip: str = '0.0.0.0'


class BlockConfig(BaseModel):
    config: Config = Config()
    block_info: BlockInfo = BlockInfo()
    modem_config: ModemConfig = ModemConfig()
